package com.sailing.face.controller;

import com.sailing.face.service.FileManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;

/**
 * @author fox
 */
@Controller
@RequestMapping(value = "/appFile")
public class AppFileManagerController {

    @Autowired
    private FileManagerService fileManagerService;

    /**
     *
     * @param fileName
     * @param resp
     * 针对app访问图片的下载接口
     */

    @RequestMapping(value = "/picture/download")
    public void getPicture(String fileName, HttpServletResponse resp) {
        if (fileName == null) {
            return;
        }
        fileManagerService.downloadPicture(fileName, resp);

    }

}
